<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=request.getContextPath() %>/static/common/plugin/bootstrap-3.3.5/css/bootstrap.min.css">
<title>职位详细信息</title>
</head>
<body>
<center><h1>职位详细信息</h1></center>
职位名称：${position.name }<br>
		职责说明：${position.duty }<br>
		能力要求：${position.ability }<br>
		薪　　资：${position.salary1 }-${position.salary2 }<br>
		发布时间：<fmt:formatDate value="${position.releaseTime }" pattern="yyyy-MM-dd HH:mm:ss"/><br>
<h2>公司相关信息：</h2>
企业名称：${position.company$name }<br>
		企业邮箱：${position.company$email }<br>
		联系电话：${position.company$phone }<br>
		联 系 人 ：${position.company$linkman }<br>
		联系地址：${position.company$address }<br>
		人　　数：${position.company$numbers }<br>
		服务宗旨："${position.company$slogan }"<br>
<c:if test="${empty application }">
<select id="resume">
<option value="">-请选择简历-</option>
<c:forEach items="${resumeList }" var="resume" >
<option value="${resume.id }">${resume.intention }</option>
</c:forEach>
</select>

<button class="btn btn-primary" onclick="apply();">投递简历</button>
</c:if>	
<c:if test="${!empty application }">
<span class="label label-success">此职位已投递，目前审核状态：${application.statues }</span>
</c:if>	
<a href="<%=request.getContextPath()%>/index.jsp">返回首页</a>	
<script>
  function apply(){
	  var resumeId = document.getElementById('resume').value;
	  if (resumeId == '') {
			 alert('请先选择简历，再执行职位投递!');
		 } else {
			 location='<%=request.getContextPath() %>/ApplicationServlet?command=apply&resumeId=' + resumeId + '&positionId=${position.id}'
		 }
  }






</script>



</body>

</html>